﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace FastGraphClustering_13._12
{
    class Cluster
    {
        static int clusterID = 0;
        public int[] nodesInCluster;
        public int numOfNodes, numofEdgesIn=-1, numofEdgesOut=-1;
        public double edgesPercent=-1;
        public Network ThisNetwork;
        public Boolean NetworkExists, QualityExists;
        public int numOfUsersWithInterests=-1, numOfUsers1stInterests=-1;
        public int numOfUsersWithMemberOf = -1, numOfUsers1stMemberOf = -1;
        public string Interests1st = " ", MemberOf1st = " ",interest1stpercent=" ";


        public Cluster(int maxNumOfNodes,int ClusterNumberPlus1)
        {
            edgesPercent = -ClusterNumberPlus1;
            clusterID++;
            nodesInCluster = new int[maxNumOfNodes];
            for (int i = 0; i<maxNumOfNodes; i++)
                nodesInCluster[i] = -1;
            numOfNodes = 0;
            NetworkExists = false;
            QualityExists = false;
          
        }
        

        public void insertNode(int indexOfNode)
        {
            numOfNodes++;
            nodesInCluster[numOfNodes-1] = indexOfNode;
           
        }

        public void deletetNode(int indexOfNode)
        {
            //int j = 0;
            if (numOfNodes != 0)
            {
                for (int i = 0; i < numOfNodes; i++)
                {
                    if (nodesInCluster[i] == indexOfNode)
                    {
                        for (int j = i; j < numOfNodes; j++)
                            nodesInCluster[j] = nodesInCluster[j + 1];

                    }

                }
                numOfNodes--;
            }
        }
    }
}
